import request from '@/api/utils/request';
// 宿舍楼列表
export const getDormitoryPageList = data =>
  request({
    method: 'get',
    url: '/schDormitory/getDormitoryPageList',
    params: data
  });
// 获取全部的宿舍楼信息
export const getDormitoryList = () =>
  request({
    method: 'get',
    url: '/schDormitory/getDormitoryList'
  });

/**
 * 添加宿舍楼信息
 * */
export const createDormitory = data =>
  request({
    method: 'post',
    url: '/schDormitory/createDormitory',
    data
  });
/**
 * 修改宿舍楼信息
 * */
export const updateDormitory = data =>
  request({
    method: 'post',
    url: '/schDormitory/updateDormitory',
    data
  });

/**
 * 获取宿舍楼信息
 */
export const getDormitoryInfo = id =>
  request({
    method: 'get',
    url: '/schDormitory/getDormitoryInfo/' + id
  });

/**
 * 批量删除宿舍楼信息
 *  格式: [1,2,3]
 */
export const deleteDormitory = data =>
  request({
    method: 'delete',
    url: '/schDormitory/deleteDormitory',
    data
  });
/**
 * 获取部门信息
 */
export const getDeptUserList = () =>
  request({
    method: 'get',
    url: '/schDormitory/getDeptUserList'
  });
/**
 * 根据班级和年级id获取房间信息
 * deptId : 部门id
 */
export const getUserList = data =>
  request({
    method: 'get',
    url: '/schDormitory/getUserList',
    params: { deptId: data }
  });
/**
 * 获取宿舍楼信息
 */
export const listPlaceDormitory = data =>
  request({
    method: 'get',
    url: '/schDormitory/listPlaceDormitory',
    params: data
  });

export const listPlaceDormitoryTree = data =>
  request({
    method: 'get',
    url: '/schDormitory/listPlaceDormitoryTree',
    params: data
  });

/**
 * 选取部门数组人员的长度
 * deptId :   部门id
 * index :    选择的数据的长度(选填)
 */
export const getDeptIdUserList = data =>
  request({
    method: 'get',
    url: '/schDormitory/getDeptIdUserList',
    params: data
  });

/**
 * 获取当前学校所有部门组织架构
 */
export const getAllDeptInfo = () =>
  request({
    method: 'get',
    url: '/schDormitory/getAllDeptInfo'
  });
/**
 * 获取当前学校所有部门组织架构 最新的 教职工信息管理用到的 新增住宿信息的时候
 */
export const schTeacherDormitoryRelation = () =>
  request({
    method: 'get',
    url: '/schTeacherDormitoryRelation/getAllDeptInfo'
  });
